// ignore_for_file: file_names, must_be_immutable, constant_identifier_names, slash_for_doc_comments, avoid_unnecessary_containers, prefer_const_constructors, unnecessary_cast, sized_box_for_whitespace, prefer_function_declarations_over_variables, overridden_fields, annotate_overrides, prefer_const_literals_to_create_immutables, unnecessary_null_comparison, deprecated_member_use

import 'dart:async';

import 'package:airplay_plus/airplay_plus_platform_interface.dart';

class AirplayPlus {
  // 单例公开访问点
  factory AirplayPlus() => _sharedInstance();

  // 静态、同步、私有访问点
  static AirplayPlus _sharedInstance() {
    return _instance;
  }

  // 静态私有成员，没有初始化
  static final AirplayPlus _instance = AirplayPlus._();

  // 私有构造函数
  AirplayPlus._() {}

  /**
   * @title 获取流，监听airplay连接状态
   */
  StreamController<bool> getAirPlayStatusStream() {
    return AirplayPlusPlatform.instance.getAirPlayStatusStream();
  }

  /**
   * @title 获取airplay连接状态
   */
  Future<bool> getAirPlayStatus() {
    return AirplayPlusPlatform.instance.getAirPlayStatus();
  }

  /**
   * @title 打开AirPlay面板
   */
  Future<void> airPlay() {
    return AirplayPlusPlatform.instance.airPlay();
  }
}
